package thinking.java.initalization.and.clean.up;

/**
 * @author GaoFeng
 * @date 2020/1/3 14:40
 */
public class VarArgs {

    static class A {}

    static void printArray(Object[] args) {
        for (Object obj : args) {
            System.out.println(obj + " ");
        }
    }


    public static void main(String[] args) {

        // 使用数组作为参数
        printArray(new Object[]{
                new Integer(47),
                new Float(3.14),
                new Double(11.11)
        });
        printArray(new Object[]{"one", "two", "three"});
        printArray(new Object[]{new A(), new A(), new A()});
    }


}
